chore(python): bump Python runtime from 3.9 to 3.11 - #9005
Conversation
Bump the Python runtime used across the project from 3.9 to 3.11: - backend/Dockerfile: server image base python:3.9 -> python:3.11 - backend/python/uv.sh: default uv venv python 3.9 -> 3.11 - pydevlake / azuredevops / fakeplugin pyproject.toml: python constraint "~3.9" -> ">=3.11,<3.12" - .devcontainer/devcontainer.json: python feature 3.9 -> 3.11 - backend/python/DevelopmentSetup.md: docs reference python3.11 This is a pure runtime bump. No library versions are changed and the existing Pydantic v1 code keeps working on 3.11 (verified with build-pydevlake and unit-test-python). Library upgrades (Pydantic v2, SQLModel, ...) and the corresponding poetry.lock regeneration are done in a follow-up PR. Signed-off-by: DoDiODev <DoDiDev@proton.me>
klesh
left a comment
There was a problem hiding this comment.
Why are you bumping python runtime? Are you using any python plugin?
|
@klesh We - the company for which I'm working - would like to use devlake. The precondition is that all dependencies and the used tooling is up to date. Therefore I'm working on this step by step. The reason behind this is to reduce security issues in the software used. |
|
I would recommend using the Golang Az plugin instead. The Python plugins are not actively maintained, and I am considering decommissioning them altogether to reduce the attack surface. |
|
@klesh Thanks — that's very helpful context, and I fully agree with the direction. Let me reframe this PR, because I think its rationale holds independently of the Python plugins: We are not using the Python plugin. As you recommend, we will go with the Golang Azure DevOps plugin ( Python remains a required runtime even without the Python plugins, because of dbt:
So this PR is really "stop shipping an EOL Python interpreter in our images", not "invest in the Python plugin framework". If the Python plugins are decommissioned, this PR gets smaller, not obsolete — the One question, so I can align my follow-up work with your plans: is there an issue or a rough timeline for decommissioning the Python plugin framework ( Related, and probably interesting for the same "reduce attack surface" reason: |
Thanks for the detailed explanation—I really appreciate it! You're spot on. My plan is to deprecate the problematic Following that, I plan to deprecate the Python subsystem over the subsequent 3 months. I got your point and I am merging the PR for the time being. |
Summary
Bump the Python runtime used across the project from 3.9 to 3.11. This is a
pure runtime bump: no library versions are changed and the existing Pydantic v1
code keeps working on 3.11.
Changes
backend/Dockerfilepython:3.9-slim-bookworm→python:3.11-slim-bookwormbackend/python/uv.shuv venvpython3.9→3.11backend/python/pydevlake/pyproject.tomlpython = "~3.9"→">=3.11,<3.12"backend/python/plugins/azuredevops/pyproject.tomlpython = "~3.9"→">=3.11,<3.12"backend/python/test/fakeplugin/pyproject.tomlpython = "~3.9"→">=3.11,<3.12".devcontainer/devcontainer.json3.9→3.11backend/python/DevelopmentSetup.mdpython3.11Explicitly out of scope
sqlmodel,pydantic,pytest,inflect,fire,jsonpointeretc. stay unchanged. Pydantic v2 / SQLModel migration and thecorresponding
poetry.lockregeneration are handled in a follow-up PR to keepthis change reviewable and independently revertable.
18).Testing
Automated (on Python 3.11.15):
make build-pydevlake✅ (resolves withpydantic 1.10.26,sqlmodel 0.0.8)make unit-test-python✅ (azuredevops: 8 passed / 1 skipped, pydevlake: 10 passed)Manual:
basestage frombackend/Dockerfile→ image reportsPython 3.11.15, Python remote plugins build successfully.plugin-infoRPChandshake payload (name, extension, 12 subtasks, 14 migration scripts) on 3.11.
Known unrelated issue
devcontainer buildcurrently fails to pullmcr.microsoft.com/devcontainers/go:1-1.26-bookworm(
.devcontainer/Dockerfile). This base-image reference is not touched by this PRand fails identically on
main; it is independent of the Python 3.11 change.Rollback
Revert this single commit; it only changes version strings and has no schema or data impact.